﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/11/10 星期日 20:10:07
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sector7.Framework.Drivers.RF
{
    /// <summary>
    /// <!-- The description about this class. -->
    /// </summary>
    public class RfReaderException : Exception
    {
        #region Accessor
        /// <summary>
        /// 获取错误码
        /// </summary>
        public int ErrorCode
        {
            get { return m_errorCode; }
        }

        /// <summary>
        /// 获取描述当前错误的消息
        /// </summary>
        public string ErrorMessage
        {
            get { return m_errorMessage; }
        }
        #endregion

        #region Structure
        public RfReaderException(int errorCode)
        {
            m_errorCode = errorCode;

            switch (m_errorCode)
            {
                case RfReader_ErrorCode.ERR_RF_SUCCESS:
                    m_errorMessage = "操作成功！";
                    break;
                default:
                    m_errorMessage = string.Format("{0} 未知错误！", m_errorCode);
                    break;
            }
        }
        #endregion

        #region Inner members
        private int m_errorCode = RfReader_ErrorCode.ERR_RF_SUCCESS;
        private string m_errorMessage = "操作成功！";
        #endregion
    }
}
